let mongoose = require("mongoose");
mongoose.connect("mongodb://localhost:27017/newQY",{
    useNewUrlParser:true,
    useUnifiedTopology:true
}).then(()=>{
    console.log("token数据表连接成功！");
}).catch(()=>{
    console.log("token数据表连接失败！");
})
let schema = mongoose.Schema;
let tokenList = new schema({
    //用户
    user:{
        type:String,
        required:true,
    },
    //随机值
    random:{
        type:String,
        required:true,
    },
    //token
    token:{
        type:String,
        required:true,
    },
    //创建时间
    createTime:{
        type:String,
        required:true,
    },
    //过期时间
    outTime:{
        type:String,
        required:true,
    },
    //随机字符串
    randomStr:{
        type:String,
        required:true,
    }
})
let token = mongoose.model("tokenlist",tokenList);

module.exports = {
    token
}